<?php
if (!defined('MVC_ROOT_DIR'))  die('Hacking attempt');
class BaseAdminActions extends Actions {
	public $user;
	public $userModel;
	public $home;
	function __construct()
	{	
		$this->noCache();
		Files::factory('AdminUser');
		Files::loadPlugin('Page');
		$userModel = new AdminUser();
		$this->userModel = $userModel;
		if (!$userModel->isLogin()){			
			$this->location('admin.php/admin/user','parent');
		}else 
		{
			$user = $userModel->getUser();
		}	
		
		$this->user=$user['userinfo'];		
		
		Files::factory('AdminHome');
		$home = new AdminHome();
		$this->home = $home;
		$menu = $home->getMenu();
		$nav = $home->getThisNav();
		$thisMenu = $home->getThisMenu();		
		$this->assign('menu', $menu);
		$this->assign('nav', $nav);	
		$this->assign('thisMenu', $thisMenu);		
		$this->assign('user', $this->user);
		$this->addJs(MVC_WWW_HOST.'js/jquery/jquery.js');
		//$this->addJs(MVC_WWW_HOST.'js/jquery/jquery.json-2.2.min.js');
		$this->addJs(MVC_WWW_HOST.'js/jquery/jquery.cookie.js');
		
		$this->addJs(MVC_WWW_HOST.'js/system/basic.js');
		$this->addCss(MVC_WWW_HOST.'js/simplemodal/css/basic.css');		
		$this->addJs(MVC_WWW_HOST.'js/simplemodal/jquery.simplemodal.js');		
		$this->addJs(MVC_WWW_HOST.'js/My97DatePicker/WdatePicker.js');
		$this->addCss(MVC_WWW_HOST.'css/adminpage.css');		;	
		$this->assign('title', '理管理平台');
			
		
	}
	
	
}
